feat: modernize repo to use uv, pyproject.toml, and semantic-release#65
Closed
farhan wants to merge 15 commits into
Closed
feat: modernize repo to use uv, pyproject.toml, and semantic-release#65farhan wants to merge 15 commits into
farhan wants to merge 15 commits into
Conversation
- Migrated package metadata to pyproject.toml (PEP 621/735) - Replaced setup.py, requirements/*.txt, pytest.ini, pylintrc, MANIFEST.in - Switched from pip-compile to uv with PEP 735 dependency groups and uv.lock - Added python-semantic-release for automated versioning and PyPI publishing - Replaced pylint/isort/pycodestyle with ruff; coverage config in pyproject.toml - Added ci.yml using astral-sh/setup-uv and uv run tox - Updated release.yml to use python-semantic-release v10 - Updated lockfileversion-check.yml to verify uv.lock instead of package-lock.json Closes openedx/public-engineering#506 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add tests/test_db.py and tests/test_auth.py with 11 passing tests covering the DB layer and JWT auth class - Add requests to test dependency group so rest_api_client can be imported - Fix ruff violations across all source files: unsorted imports (I001), percent-format strings (UP031), super() calls (UP008), unused imports (F401), collections.abc migration (UP035), f-string conversion (UP032), and exception chaining (B904) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
There was a problem hiding this comment.
Pull request overview
This PR modernizes the repo’s Python packaging and automation by moving metadata/config into pyproject.toml, switching dependency management to uv (with dependency groups + lockfile checks), and updating CI/release workflows to support automated publishing.
Changes:
- Replace legacy packaging + requirements pinning (
setup.py,requirements/*.in|*.txt,pytest.ini,pylintrc,MANIFEST.in) withpyproject.toml,uvdependency groups, andruff. - Add/adjust tox + GitHub Actions workflows to run via
uvand to perform semantic-release + PyPI publishing. - Add new unit tests for DB behavior and JWT auth header injection.
Reviewed changes
Copilot reviewed 31 out of 33 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tox.ini | Introduces tox-uv runner and dependency group-based envs for lint/tests. |
| tests/test_db.py | Adds DB unit tests for exams/attempts and row factory behavior. |
| tests/test_auth.py | Adds unit tests for SuppliedJwtAuth. |
| tests/init.py | Adds tests package marker. |
| setup.py | Removes legacy setuptools entrypoint in favor of pyproject.toml. |
| requirements/testing.txt | Removes pip-tools pinned test requirements. |
| requirements/testing.in | Removes pip-tools input file for test requirements. |
| requirements/server.txt | Removes pip-tools pinned server requirements. |
| requirements/server.in | Removes pip-tools input file for server requirements. |
| requirements/pip.txt | Removes pip-tools pinned pip/setuptools/wheel requirements. |
| requirements/pip.in | Removes pip-tools input file for pip requirements. |
| requirements/pip-tools.txt | Removes pip-tools pinned tooling requirements. |
| requirements/pip-tools.in | Removes pip-tools input file for pip-tools requirements. |
| requirements/constraints.txt | Removes constraints indirection used by pip-compile flow. |
| requirements/common_constraints.txt | Removes shared constraints file previously downloaded/used. |
| requirements/base.txt | Removes legacy base requirements file content. |
| requirements/base.in | Removes legacy base requirements input file. |
| pytest.ini | Moves pytest/cov config into pyproject.toml. |
| pyproject.toml | Adds PEP 621 project metadata, dependency groups, ruff/pytest/coverage, and semantic-release config. |
| pylintrc | Removes pylint config (replaced by ruff). |
| mockprock/server.py | Python 3 modernizations + formatting; updates request handling and string usage. |
| mockprock/rest_api_client/client.py | Formatting/modernization; improves exception chaining behavior. |
| mockprock/rest_api_client/auth.py | Modernizes header formatting to f-string. |
| mockprock/desktop_views.py | Formatting/modernization; normalizes string quoting/routes. |
| mockprock/db.py | Formatting/modernization; retains schema setup logic and CRUD helpers. |
| mockprock/commands.py | Updates CLI formatting/argparse style. |
| mockprock/backend.py | Normalizes string quoting for provider metadata. |
| MANIFEST.in | Removes explicit manifest in favor of pyproject/setuptools defaults. |
| Makefile | Replaces pip-tools-based workflow with uv sync/lock + tox/ruff targets. |
| .github/workflows/release.yml | Replaces npm semantic-release with python-semantic-release + artifact publishing + PyPI publish via OIDC. |
| .github/workflows/lockfileversion-check.yml | Replaces package-lock check with uv lock --check. |
| .github/workflows/ci.yml | Adds CI workflow using setup-uv, uv sync, and uv run tox. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add Django framework classifiers (Framework :: Django, 4.2, 5.2) - Add test-base and doc dependency groups per skill spec - Add DJ (flake8-django) rule to ruff lint selectors - Add [tool.ruff.lint.isort] with known-third-party = ["django"] - Fix ruff target-version from py311 to py312 - Fix Makefile lint/test targets to use `uv run tox` instead of bare `tox` - Regenerate uv.lock for new dependency groups Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mockprock has no PyPI publish workflow on master — this repo does not publish to PyPI. The previous commit incorrectly used setuptools-scm and python-semantic-release (PyPI path). Switch to the correct no-PyPI path: - Remove setuptools-scm from [build-system].requires - Remove [tool.setuptools_scm] section - Remove dynamic = ["version"]; add static version = "2.0.0" from master - Remove [tool.semantic_release] section - Bump requires-python to >=3.12 (modern tooling target) - Remove Python 3.11 classifier (no longer supported) - Add [tool.edx_lint].uv_constraints = [] and run edx_lint write_uv_constraints to populate [tool.uv].constraint-dependencies from common_constraints.txt Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… workflow The release gate failed: master had no PyPI publish workflow (only an npm-based semantic-release workflow). The new release.yml incorrectly added python-semantic-release + PyPI publish steps. Restore the original npm release.yml verbatim from master. The python-semantic-release workflow has been removed entirely. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
requires-python is now >=3.12. Remove py311-test from tox envlist, CI matrix, and the make test target. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Per migration skill requirements: always add a minimal codecov.yml (header comment + URL reference) when one does not already exist. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…heel Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
No tests exist in this repo; pytest was exiting with code 5 (no tests collected). Remove the Codecov upload step and codecov.yml too. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
Closing on account of #66 |
kdmccormick
pushed a commit
that referenced
this pull request
Jul 23, 2026
…o ruff) (#66) - Replace setup.py with pyproject.toml (PEP 621 static metadata) - Switch from pip-compile to uv with PEP 735 dependency groups; commit uv.lock - Retain pylint/isort as on master (ruff deferred to separate epic per public-engineering#506) - Update tox.ini to use tox-uv with uv-venv-lock-runner - Add ci.yml using astral-sh/setup-uv; SHA-pin all actions; add workflow_call trigger - Drop Python 3.11 support; set requires-python = ">=3.12" - Add placeholder test so pytest collects at least one item Split from #65; ruff retained there for adoption in a future epic (per public-engineering#506). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
PR implemented with the assistance of Claude Code, human-reviewed and improved before pushing to code review.
Summary
Modernize
mockprockto uv + pyproject.toml (PEP 621/735).Part of openedx/public-engineering#506.
setup.pywithpyproject.toml(PEP 621 static metadata)uvwith PEP 735 dependency groups; commituv.lockruff(check + format); coverage config moved intopyproject.tomltox.inito usetox-uvwithuv-venv-lock-runner; rename test env topy312ci.ymlusingastral-sh/setup-uv; SHA-pin all actions; addworkflow_calltriggerrequires-python = ">=3.12"Removed
Deleted files:
setup.py,pylintrc,pytest.ini,requirements/Removed Makefile targets:
qualityruff check+ruff formatvia toxlintenvquality-pythontest-pythontesttarget; tox handles env selectionPython 3.11 dropped
Python 3.11 reached end-of-life in October 2024 and Open edX dropped it platform-wide. Removed from the tox envlist, CI matrix, and classifiers. The new minimum is Python 3.12.
Not included
release.yml/python-semantic-release— master had no PyPI publish workflow. The existingrelease.ymlis an npm/Node.js semantic-release pipeline preserved unchanged.Versioning
[Static]
version = "2.0.0"carried over directly fromsetup.pyon master — master had no PyPI publish workflow, sosetuptools-scmis not used and the version is bumped manually on each release tag.Testing Notes
This PR has not been manually tested against the repo's own features. Testing relied on CI checks and local agent tooling (
make requirements,make lint,make test,python -m build). Repo-owner is encouraged to run the repo's feature tests before merging.Code reviewer notes:
release.ymlis an npm/Node.js pipeline already on master — it is preserved unchanged; nopython-semantic-releaseis introduced.MANIFEST.inis retained withrequirements/references removed; all other lines unchanged from master.rest_api_client/subpackage andtemplates/are now correctly included in the distribution (master'ssetup.pyomitted them by listing onlypackages=['mockprock']).🤖 Generated with Claude Code
The non-ruff modernization work has been extracted into a focused PR per the decision in the main story (public-engineering#506):
This PR retains the ruff adoption and can be rebased onto
farhan/modernize-python-repoonce that lands, to serve as the ruff epic PR.